'''
Author: your name
Date: 2020-10-28 17:07:29
LastEditTime: 2020-10-28 17:31:16
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: \python-study\博客学习\标准库学习\时间库.py
https://www.cnblogs.com/vamei/archive/2012/09/03/2669426.html
'''
import time
import datetime

if __name__=="__main__":
    print(time.time())
    print('start')
    # time.sleep(10)
    print('end')
    st = time.gmtime()      # 返回struct_time格式的UTC时间
    print(st)
    st = time.localtime()   # 返回struct_time格式的当地时间, 当地时区根据系统环境决定。
    print(st)

    s  = time.mktime(st)    # 将struct_time格式转换成wall clock time
    print(s)
    t = datetime.datetime(2012,9,3,21,30)
    print(t)

    t      = datetime.datetime(2012,9,3,21,30)
    t_next = datetime.datetime(2012,9,5,23,30)
    delta1 = datetime.timedelta(seconds = 600)
    delta2 = datetime.timedelta(weeks = 3)
    print(t + delta1)
    print(t + delta2)
    print(t_next - t)
